using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_ItemActivityMap : EntityTypeConfiguration<so_ItemActivity>
    {
        public so_ItemActivityMap()
        {
            // Primary Key
            this.HasKey(t => t.ExpiryDate);

            // Properties
            this.Property(t => t.Item)
                .HasMaxLength(10);

            this.Property(t => t.Description)
                .HasMaxLength(250);

            this.Property(t => t.Location)
                .HasMaxLength(3);

            this.Property(t => t.Transaction_Type)
                .HasMaxLength(30);

            this.Property(t => t.Document_ID)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("so_ItemActivity");
            this.Property(t => t.Item).HasColumnName("Item");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.Location).HasColumnName("Location");
            this.Property(t => t.ExpiryDate).HasColumnName("ExpiryDate");
            this.Property(t => t.Qty).HasColumnName("Qty");
            this.Property(t => t.Transaction_Type).HasColumnName("Transaction_Type");
            this.Property(t => t.Document_Date).HasColumnName("Document_Date");
            this.Property(t => t.Document_ID).HasColumnName("Document_ID");
        }
    }
}
